This application is based upon and claims the benefit of priorities from the prior Japanese Patent Applications No. 2000-254065 filed on Aug. 24, 2000 and No. 2001-247430 filed on Aug. 16, 2001, the entire contents of both of which are incorporated herein by reference.
The present invention relates to a technology for expressing an object using computer graphics, etc., and more specifically, to an image processing technology for transforming coordinates of shape specific points which specify the shape of a graphic that represents an object, so as to express the behavior of the object such as motion and deformation.
Recent years have seen significant advances in the computer-graphics-related technology and the results of various computer-simulated events are now visually expressed through a display. For example, conducting a simulation on an object created by means of CAD (Computer Aided Design) and expressing the simulation result visually through computer graphics to check the behavior of the object such as motion and deformation constitutes an important step in design and development of a product.
Motion of an object, motion of a rigid body in particular, is expressed using the following transformation matrix (Equation 1). This transformation matrix is intended to transform coordinate values of a shape specific point P (X, Y, Z) for specifying the shape of a rigid body using a 4xc3x974 transformation matrix and determine a transformed shape specific point Pxe2x80x2(Xxe2x80x2, Yxe2x80x2, zxe2x80x2). In this Specification, a xe2x80x9cshape specific pointxe2x80x9d refers to a point for specifying the shape of an object such as a vertex.                               (                                                                      X                  xe2x80x2                                                                                                      Y                  xe2x80x2                                                                                                      Z                  xe2x80x2                                                                                    1                                              )                =                              (                                                                                R                    00                                                                                        R                    01                                                                                        R                    02                                                                                        R                    03                                                                                                                    R                    10                                                                                        R                    11                                                                                        R                    12                                                                                        R                    13                                                                                                                    R                    20                                                                                        R                    21                                                                                        R                    22                                                                                        R                    23                                                                                                0                                                  0                                                  0                                                  1                                                      )                    ⁢                      xe2x80x83                    ⁢                      (                                                            X                                                                              Y                                                                              Z                                                                              1                                                      )                                              [                  Equation          ⁢                      xe2x80x83                    ⁢          1                ]            
Of the above transformation matrix, the 3xc3x973 matrix section with the 1st to 3rd rows and the 1st to 3rd columns represents a rotational displacement, while the 1xc3x973 matrix section with the 4th column represents a translation. Since the 3xc3x973 matrix section with the 1st to 3rd rows and the 1st to 3rd columns is a matrix that represents a rotational displacement, it satisfies the condition of the following Equation 2:                               R          =                      (                                                                                R                    00                                                                                        R                    01                                                                                        R                    02                                                                                                                    R                    10                                                                                        R                    11                                                                                        R                    12                                                                                                                    R                    20                                                                                        R                    21                                                                                        R                    22                                                                        )                          ⁢                  
                ⁢                              R                          -              1                                =                                                   t                        ⁢            R                          ⁢                  
                ⁢                              det            ⁢                          xe2x80x83                        ⁢            R                    =          1                                    [                  Equation          ⁢                      xe2x80x83                    ⁢          2                ]            
Motion of a rigid body is expressed by computing the above-described transformation matrix for all shape specific points of the graphic that represents the object. In the case of a rigid body, a positional relationship such as a distance between a plurality of shape specific points of one object does not change. Therefore, it is also possible to determine coordinate values of other shape specific points from the positional relationship with the shape specific point Pxe2x80x2 determined by the Equation 1.
Here, since an object is represented by a three-dimensional graphic, the transformation matrix is set to be a 4xc3x974 matrix. However, when an object is represented by a two-dimensional graphic, a similar transformation can be performed using a 3xc3x973matrix. In this case, Equation 2 is changed so as to hold for a 2xc3x972 matrix with elements R00, R01, R10 and R11.
On the other hand, if the object is an elastic body, its motion is expressed by regarding the object as a model with a plurality of shape specific points for specifying the shape of a graphic that represents the object, mutually connected via a virtual spring. The elastic body is expressed by solving an equation of motion of a force of the spring acting on each shape specific point.
For example, in the case of a model with a shape specific point P connected to three neighboring shape specific points via three springs, suppose when the shape specific point P is regarded as a starting point, position vectors of the three neighboring shape specific points at time t are v0(t), v1(t) and v2(t), spring constants are k0, k1 and k2 and natural lengths of the springs are L0, L1 and L2. Then, a force F(t) that acts on the shape specific point P is expressed by the following Equation 3:                               F          ⁢                      xe2x80x83                    ⁢                      (            t            )                          =                                            k              0                        ⁢                          xe2x80x83                        ⁢                          (                                                "LeftBracketingBar"                                                            v                      0                                        ⁢                                          xe2x80x83                                        ⁢                                          (                      t                      )                                                        "RightBracketingBar"                                -                                  L                  0                                            )                        *                                                            v                  0                                ⁢                                  xe2x80x83                                ⁢                                  (                  t                  )                                                            "LeftBracketingBar"                                                      v                    0                                    ⁢                                      xe2x80x83                                    ⁢                                      (                    t                    )                                                  "RightBracketingBar"                                              +                                    k              1                        ⁢                          xe2x80x83                        ⁢                          (                                                "LeftBracketingBar"                                                            v                      1                                        ⁢                                          xe2x80x83                                        ⁢                                          (                      t                      )                                                        "RightBracketingBar"                                -                                  L                  1                                            )                        *                                                            v                  1                                ⁢                                  xe2x80x83                                ⁢                                  (                  t                  )                                                            "LeftBracketingBar"                                                      v                    1                                    ⁢                                      xe2x80x83                                    ⁢                                      (                    t                    )                                                  "RightBracketingBar"                                              +                                    k              2                        ⁢                          xe2x80x83                        ⁢                          (                                                "LeftBracketingBar"                                                            v                      2                                        ⁢                                          xe2x80x83                                        ⁢                                          (                      t                      )                                                        "RightBracketingBar"                                -                                  L                  2                                            )                        *                                                            v                  2                                ⁢                                  xe2x80x83                                ⁢                                  (                  t                  )                                                            "LeftBracketingBar"                                                      v                    2                                    ⁢                                      xe2x80x83                                    ⁢                                      (                    t                    )                                                  "RightBracketingBar"                                                                        [                  Equation          ⁢                      xe2x80x83                    ⁢          3                ]            
Suppose the shape specific point P is a mass point, the mass of the shape specific point P is M, the damping coefficient of vibration of spring is D, and the coordinate value of the shape specific point P at time t is P(t)=(x(t), y(t), z(t)). Then, the equation of motion of the shape specific point P is expressed by the following Equation 4:                               M          ⁢                      xe2x80x83                    ⁢                                                    ⅆ                2                            ⁢                              xe2x80x83                                                    ⅆ                              t                2                                              ⁢                      xe2x80x83                    ⁢          P          ⁢                      xe2x80x83                    ⁢                      (            t            )                          =                              F            ⁢                          xe2x80x83                        ⁢                          (              t              )                                -                      D            ⁢                          xe2x80x83                        ⁢                                          ⅆ                                  xe2x80x83                                                            ⅆ                t                                      ⁢                          xe2x80x83                        ⁢            P            ⁢                          xe2x80x83                        ⁢                          (              t              )                                                          [                  Equation          ⁢                      xe2x80x83                    ⁢          4                ]            
Solving this equation of motion allows the coordinate value P(t) of the shape specific point P at time t to be calculated. The elastic body is expressed by applying the above-described computation to all shape specific points of the graphic that represents the elastic body.
Such a coordinate transformation for expressing an elastic body requires computations of Equation 3 and Equation 4 to be carried out for all shape specific points that specify the shape of the graphic that expresses the elastic body. The load on the image processing apparatus that carries out such computations becomes enormous as the amount of computation is enormous. For this reason, in the case where it is necessary to display an elastic body in real time in a video game, etc., a high performance image processing apparatus is required. This is because if the performance of the image processing apparatus is low, its computation processing will not catch up with the motion of the elastic body, which causes the motion of the elastic body to appear unnatural.
However, high performance image processing apparatuses tend to be costly and cannot be used for apparatuses, such as home video game machines, which require high cost performance. Thus, there is a demand for a technology capable of expressing the behavior of an object in a quasi-natural manner while suppressing the load on the apparatus to a minimum.
Therefore, it is an object of the present invention to provide an image processing technology capable of expressing the behavior of an object such as displacement and deformation naturally while suppressing the load on the apparatus to a minimum.
According to one aspect of the present invention, there is provided an image processing method executed in an apparatus for transforming coordinates of shape specific points that specify a shape of a graphic representing an object so as to generate graphics data representing a behavior of the object, the method comprising the steps of: setting a transformation matrix having elements each of which is expressed by a function having time as a variable, the function converging to a corresponding element of a matrix that represents a behavior of the object when the object is assumed to be a rigid body; and transforming the coordinates of the shape specific points using the transformation matrix and generating the graphics data based on the coordinates obtained.
Conventionally, expressing the motion of an elastic body requires equations of motion to be solved for all shape specific points that specify the shape of the elastic body as described above. The present invention, however, makes it possible to express the behavior of the elastic body using a matrix like expressing the behavior of a rigid body in the conventional technique. Thus, the load on the apparatus is reduced significantly.
Since each element of the transformation matrix is expressed as a function having time as a variable, Equations 1 and 2 are not always satisfied. Therefore, the shape of an object specified by the shape specific points whose coordinates are transformed by this matrix does not always match the shape before the coordinate transformation, and as a result, the shape of the object changes thus expressing the behavior of the elastic body. Furthermore, each element of the transformation matrix converges to each element of the matrix that represents the behavior of the object when the object is assumed to be a rigid body and thus the object finally returns to its original shape, which means that the object has behaved in much the same way as the rigid body. That is, when an external force acts on the object, the object moves like an elastic body due to the external force and finally returns to the same position and takes the same shape as the behavior caused by the external force when the object is assumed to be a rigid body.
When the foregoing function of each element of the transformation matrix is set based on constants that represent physical characteristics of the object, the operation of the object becomes closer to natural behavior. This function is a solution Aij(t) to the following equation:             M      ij        ⁢          xe2x80x83        ⁢                            ⅆ          2                ⁢                  xe2x80x83                            ⅆ                  t          2                      ⁢          xe2x80x83        ⁢          A      ij        ⁢          xe2x80x83        ⁢          (      t      )        =                    k        ij            ⁢              xe2x80x83            ⁢              (                                            A              ij                        ⁢                          xe2x80x83                        ⁢                          (              t              )                                -                      R            ij                          )              -                  D        ij            ⁢              xe2x80x83            ⁢                        ⅆ                      xe2x80x83                                    ⅆ          t                    ⁢              xe2x80x83            ⁢              A        ij            ⁢              xe2x80x83            ⁢              (        t        )            
wherein
Mij, kij, Dij: the constants to define the physical characteristics of the object
Aij: the function that expresses an element at row i, column j of the transformation matrix
Rij: a value of an element at row i, column j of the matrix when the object is assumed to be a rigid body
i: 0 to 3, j: 0 to 3
t: time.
This equation is a differential equation that corresponds to the equation of motion of a mass point by a spring used for expressing an elastic body in the conventional technique. By deriving a function Aij(t) that expresses each element of the transformation matrix from this differential equation, it is possible to express the motion of the elastic body, which, with a lapse of time t, ends up taking the shape when the object is assumed to be a rigid body while damping in vibration.
Conventionally, for expressing the behavior of an elastic body, it is necessary to solve as many equations of motion as the number of shape specific points. According to the present method, however, it is only necessary to solve as many differential equations as the number of elements of the transformation matrix. The number of elements of a matrix is 16 even when the object is expressed in a three-dimensional space. On the other hand, the number of shape specific points increases as the shape of the elastic body becomes more complicated. The more complicated the shape of the elastic body, or the greater the number of shape specific points, the greater the effect of the present invention becomes.
According to another aspect of the present invention, there is provided an image processing apparatus for transforming coordinates of shape specific points that specify a shape of a graphic representing an object so as to generate graphics data representing a behavior of the object, the apparatus comprising: means for generating a transformation matrix having elements each of which is expressed by a function having time as a variable, the function converging to a corresponding element of a matrix that represents a behavior of the object when the object is assumed to be a rigid body; and means for transforming the coordinates of the shape specific points using the transformation matrix and generating the graphics data based on the coordinates obtained.
It may be arranged that the image processing apparatus further comprises recording means for recording constants that represent physical characteristics of the object, wherein the means for generating the transformation matrix is configured to set an equation for each element of the transformation matrix based on the constants and derive the function from the equation.
According to another aspect of the present invention, there is provided a semiconductor device for transforming coordinates of shape specific points that specify a shape of a graphic representing an object so as to generate graphics data representing a behavior of the object, the semiconductor device comprising: means for generating a transformation matrix having elements each of which is expressed by a function having time as a variable, the function converging to a corresponding element of a matrix that represents a behavior of the object when the object is assumed to be a rigid body; and means for transforming the coordinates of the shape specific points using the transformation matrix and generating the graphics data based on the coordinates obtained.
Furthermore, the present invention can also be implemented by allowing a general-purpose computer of a game dedicated computer apparatus or home computer apparatus, etc. to load and execute a computer program recorded in a computer-readable recording medium.
Specifically, according to another aspect of the present invention, there is provided a recording medium recorded with a computer program for causing a computer to operate as an image processing apparatus for transforming coordinates of shape specific points that specify a shape of a graphic representing an object so as to generate graphics data representing a behavior of the object, the computer program causing the computer to execute the steps of: generating a transformation matrix having elements each of which is expressed by a function having a time as a variable, the function converging to a corresponding element of a matrix that represents a behavior of the object when the object is assumed to be a rigid body; and transforming the coordinates of the shape specific points using the transformation matrix and generating the graphics data based on the coordinates obtained.